#include "ex14_5.h"

std::istream &operator>>(std::istream &in, Book &book) {
  in >> book.no_ >> book.name_ >> book.author_ >> book.pubdate_;
  return in;
}

std::ostream &operator<<(std::ostream &out, const Book &book) {
  out << book.no_ << " " << book.name_ << " " << book.author_ << " "
      << book.pubdate_;
  return out;
}

bool operator==(const Book &lhs, const Book &rhs) { return lhs.no_ == rhs.no_; }

bool operator!=(const Book &lhs, const Book &rhs) { return !(lhs == rhs); }

int main() {
  Book book1(123, "CP5", "Lippman", "2012");
  Book book2(123, "CP5", "Lippman", "2012");

  if (book1 == book2)
    std::cout << book1 << std::endl;
}